1. Field of the Invention
The present invention relates to a distance calculating apparatus, an image pick-up apparatus using the same, a distance calculating method, a program for realizing distance calculation, and a storage medium having the program stored thereon, and more particularly, to a distance calculating apparatus for use, for example, in an image pick-up apparatus such as a digital camera or a digital video camera, and the like.
2. Description of the Related Art
Regarding a digital camera or a digital video camera, there has been proposed a depth-from-defocus (DFD) method capable of acquiring a distance to an object to be photographed (Japanese Patent No. 4403477). In the DFD method, imaging is performed twice with different imaging conditions (for example, aperture value and focal length) of an imaging lens mounted in the digital camera or the like to acquire two images having different bokeh depending on object distances. Then, after calculating a correlation value between the images for each pixel, the object distance, which is the distance to the object, may be calculated for each pixel by referring to a look-up table, which defines a relationship between a correlation amount of the bokeh and the object distance.
In the DFD method, the images and the object distance (hereinafter also referred to as object distance information) of each pixel may be acquired. An amount of bokeh of the object in the images depends on the object distance. By processing the acquired images based on the object distance information, image processing such as bokeh rendering, refocusing (processing of focusing on an arbitrary position), or the like may be performed appropriately on the photographed images.
In order to appropriately perform the image processing based on the object distance, it is desired to calculate the object distance with high accuracy. In the DFD method, the imaging needs to be performed twice with the different imaging conditions to acquire the two images. Therefore, for a moving object, the same object is located at different angles of field between the images, and hence there are cases where the correlation value between the images cannot be calculated with high accuracy. Also in a case where a moving speed of the object changes between the images, the amount of blur of the object is different between the images, and hence there are cases where the correlation value between the images cannot be calculated with high accuracy. As a result, depending on the object, there are cases where the object distance cannot be calculated with high accuracy. In this manner, in a distance calculating apparatus using the conventional DFD method, the imaging needs to be performed multiple times to acquire the object distance, and hence depending on the object, there have been cases where the object distance is calculated incorrectly.